﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace WantSideEffectP18_3 {
    internal class Program {
        static void Main(string[] args) {
            int y = 1;
            IWantSideEffect(ref y);
            //结果为101，因为这里是引用传递，ref 是声明为引用传递
            Console.WriteLine(y);
            Console.ReadLine();
        }

        /**
         * 基本数据类型的引用传递
         */
        static void IWantSideEffect(ref int x) {
            x = x + 100;
        }
    }

    
}
